# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
  'require.resolve(
    "react-native/scripts/react_native_pods.rb",
    {paths: [process.argv[1]]},
  )', __dir__]).strip

platform :ios, min_ios_version_supported
prepare_react_native_project!

target 'MasterBoy' do
  config = use_native_modules!

  # Use static frameworks for React Native compatibility
  use_frameworks! :linkage => :static
  
  use_react_native!(
    :path => config[:reactNativePath],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/..",
    # Enable Fabric (New Architecture)
    :fabric_enabled => true,
    # Enable Hermes
    :hermes_enabled => true
  )
  
  pod 'SnapKit','5.6.0'
  pod 'YYText','1.0.7'
  pod 'FDFullscreenPopGesture','1.1'
  pod 'Toast-Swift', '5.0.1'
  pod 'Alamofire','5.6.4'
  pod 'SwiftyJSON','5.0.1'
  pod 'MJRefresh', '3.7.5'
  pod 'JLRoutes', '2.1'
  pod 'LGAlertView'
  pod 'NVActivityIndicatorView'
  pod 'SDCycleScrollView', '1.82'
  
  pod 'RxSwift', '6.5.0'
  pod 'RxCocoa', '6.5.0'
  
  # Add the Firebase pod for Google Analytics
#  pod 'FirebaseAnalytics','10.16.0'
  pod 'ReachabilitySwift'
  pod 'Kingfisher', '7.8.0'
  pod 'LookinServer', :subspecs => ['Swift'], :configurations => ['Debug']
  
  pod 'CocoaLumberjack','3.8.1'

  # For Analytics without IDFA collection capability, use this pod instead
  # pod ‘Firebase/AnalyticsWithoutAdIdSupport’

  # Add the pods for any other Firebase products you want to use in your app
  # For example, to use Firebase Authentication and Cloud Firestore
#  pod 'FirebaseAuth','10.16.0'
#  pod 'FirebaseFirestore','10.16.0'
#  pod 'Google-Mobile-Ads-SDK','10.12.0'
#  pod 'FLEX',:configurations => ['Debug']

  # Pods for MasterBoy
#  pod 'DoraemonKit/Core', :git => "https://github.com/didi/DoraemonKit.git", :tag => '3.0.4', :configurations => ['Debug']
  
#  pod 'TZImagePickerController','3.8.4' # Full version with all features
  pod 'TZImagePickerController/Basic' # No location code

  pod 'TPNS-iOS','1.4.0.1'
  
  pod 'GBDeviceInfo', '~> 6.0'
#  pod 'GBDeviceInfo/Jailbreak', '~> 6.0'


  post_install do |installer|
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false,
      # :ccache_enabled => true
    )
  end

end

#post_install do |installer|
#  
#    installer.generated_projects.each do |project|
#          project.targets.each do |target|
#              target.build_configurations.each do |config|
#                  config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
#                  config.build_settings["DEVELOPMENT_TEAM"] = "T7Z76WDTD6"
#               end
#          end
#   end
#    #fix xcode 15 的 bug
#    installer.pods_project.targets.each do |target|
#        target.build_configurations.each do |config|
#        xcconfig_path = config.base_configuration_reference.real_path
#        xcconfig = File.read(xcconfig_path)
#        xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
#        File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
#        end
#    end
#    #fix BoringSSL-GRPC unsupported option '-G' for target 'arm64-apple-ios11.0'
#    installer.pods_project.targets.each do |target|
#      if target.name == 'BoringSSL-GRPC'
#        target.source_build_phase.files.each do |file|
#          if file.settings && file.settings['COMPILER_FLAGS']
#            flags = file.settings['COMPILER_FLAGS'].split
#            flags.reject! { |flag| flag == '-GCC_WARN_INHIBIT_ALL_WARNINGS' }
#            file.settings['COMPILER_FLAGS'] = flags.join(' ')
#          end
#        end
#      end
#    end
#end


#发版前要改
#if [ -L "${source}" ]; then
#  echo "Symlinked..."
#  source="$(readlink -f "${source}")"
#fi


#- (void)_displayAsync:(BOOL)async {
#    
#    if (self.bounds.size.width<=0 || self.bounds.size.height<=0) {
#        self.contents = nil;
#        return;
#    }
